<admintpl file="header" />
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li class="active"><a href="javascript:;">API统计</a></li>
  </ul>
  <div id="main" style="height:400px"></div>
  <script src="http://echarts.baidu.com/build/dist/echarts.js"></script>
  <script type="text/javascript">
        // 路径配置
        require.config({
            paths: {
                echarts: 'http://echarts.baidu.com/build/dist'
            }
        });
        
        // 使用
        require(
            [
                'echarts',
                'echarts/chart/funnel',
                'echarts/chart/pie',
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('main')); 
                
                
                var option = {
                  title : {
                      text: 'API统计',
                      x:'center',
                  },
                  tooltip : {
                      trigger: 'item',
                      formatter: "{a} <br/>{b} : {c} ({d}%)"
                  },
                  legend: {
                    orient : 'vertical',
                    x : 'left',
                    data:{\$api}
                  },
                  toolbox: {
                      show : true,
                      feature : {
                          //mark : {show: true},
                          dataView : {show: true, readOnly: false},
                          magicType : {show: true, type: ['pie', 'funnel'],option:{
                            funnel: {
                              x: '25%',
                              width: '80%',
                              funnelAlign: 'left',
                            }
                            }
                          },
                          restore : {show: true},
                          saveAsImage : {show: true}
                      }
                  },
                  calculable : true,

                  series : [
                      {
                          name:'调用次数',
                          type:'pie',
                          data:{\$data},
                          radius : '70%',
                          center: ['50%', '60%'],
                      },
                  ]
                };
                // 为echarts对象加载数据 
                myChart.setOption(option); 
            }
        );
  </script>

</div>
<script src="__ROOT__/statics/js/common.js"></script>
<script>

function refersh_window() {
    var refersh_time = getCookie('refersh_time');
    if (refersh_time == 1) {
        window.location="{:u('AdminPost/index',$formget)}";
    }
}
setInterval(function(){
	refersh_window();
}, 2000);


</script>
</body>
</html>